<script setup>

import {getCurrentInstance, ref} from "vue";

const instance = getCurrentInstance();
const globalProperties = instance.appContext.config.globalProperties;

let val = ref("start")
const myEelFunc = () => {
  const r = globalProperties.$eel.myHello("haha")
  // 返回是promise,等待并获得值
  r().then(
      (data) => {
        val.value = data
      },
      (err) => {
        console.log(err)
      }
  )
}
</script>

<template>
  <div>{{ val }}</div>
  <button @click="myEelFunc">调用myHello</button>
</template>

<style scoped>
.read-the-docs {
  color: #888;
}
</style>
